﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Runtime.Serialization;


namespace PedesTrainProject.Traffic
{
    [Serializable()]
    public class TrafficMember: ISerializable
    {
        protected Vector position;
        protected Vector absolute_position;
        protected int starter;
        protected int destination;
        protected string skin;

        protected Core.ICoreTraffic coreTraffic;

        protected TrafficMember()
        {

        }

        protected TrafficMember(string _skin, Grid.Tile _destination, Vector _absolute_position)
        {

        }

        protected TrafficMember(string _skin, Grid.Tile _starter, Grid.Tile _destination, Vector _position)
        {

        }

        protected virtual void go()
        {

        }

        protected virtual int move()
        {
            return 0;
        }

        protected virtual void stop()
        {
        }

        #region Serialize
        public TrafficMember(SerializationInfo info, StreamingContext ctxt)
        {
            this.position = (Vector)info.GetValue("Position", typeof(Vector));
            this.absolute_position = (Vector)info.GetValue("Absolute_Position", typeof(Vector));
            this.starter = (int)info.GetValue("Starter", typeof(int));
            this.destination = (int)info.GetValue("Destination", typeof(int));
            this.skin = (string)info.GetValue("Skin", typeof(string));
        }

        public void GetObjectData(SerializationInfo info, StreamingContext ctxt)
        {
            info.AddValue("Position", this.position);
            info.AddValue("Absolute_Position", this.absolute_position);
            info.AddValue("Starter", this.starter);
            info.AddValue("Destination", this.destination);
            info.AddValue("Skin", this.skin);
        }
        #endregion
    }
}
